package com.mini.demos.webgame;

import java.util.logging.Logger;

import com.mini.demos.webgame.codec.GameCodecFactory;
import com.mini.demos.webgame.handler.GameHandlerFactory;
import com.mini.framework.communicate.mina.Config;
import com.mini.framework.communicate.mina.Mini;
import com.mini.framework.communicate.mina.ServerConfig;

public class Server {
	
	private static Logger log = Logger.getLogger("webgame");
	
	private static final int port = 2010;
	
	public static void main(String[] arg) {
		try{
			log.info("正在起动webgame....");
			ServerConfig configs = new ServerConfig();
			Config config=new Config();
			config.setServerPort(port);
			config.setCodeFactory(new GameCodecFactory());
			config.setHandlerFactory(new GameHandlerFactory());
			configs.addConfig(config);
			Mini mini = new Mini();
			mini.start(configs);
			log.info("启动webgame完毕....端口:"+port);
		}catch(Exception e){
			e.printStackTrace();
		}
		
	}

}
